﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="Socios.aspx.cs" Inherits="AppGisena.Presentacion.Up.Socios" %>

<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Xml" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>



         <!DOCTYPE html>

<html>

<body>
 
        <form id="form1" runat="server">
    <ext:ResourceManager runat="server" />
    
    
  
    
    <ext:FormPanel 
        ID="FormPanPrinc" 
        runat="server"
        Title="REGISTRAR SOCIOS A LA UNIDAD PRODUCTIVA"
        Width="600" 
        Height="600"        
        BodyPadding="10"
        DefaultAnchor="100%"
         Layout="AutoLayout"
         StyleSpec="position:absolute;top: 10%;left: 30%;width: 77px; height: 78px;margin-top: -39px; margin-left: -39px;"
        UI="Success">

      <%--Form Panel Principal  --%>
                

        <Items>
            
            <ext:FieldContainer 
                runat="server" 
                MsgTarget="Side"
                CombineErrors="true"
                FieldLabel="Codigo Up"
                Layout="HBoxLayout">
                  <Items>
                        <ext:NumberField   ID="Txt_Cod_Up" runat="server" MaxLeng="20"  AllowBlank="false" Width="150" />
                          <ext:Toolbar     runat="server"       Flex="1"     Flat="true">   
                        <Items>
                            <ext:Button ID="Button7" runat="server" Text="Buscar..." Icon="Zoom" >
                                   <DirectEvents>
                                   <Click OnEvent="Btn_BuscarUPGISENA_Click">
                                   <EventMask ShowMask="true" Msg="Buscando..." MinDelay="500" />
                                  </Click>
                           </DirectEvents>
                         </ext:Button>
                            
                        </Items>
                    </ext:Toolbar>
                  </Items>

                  </ext:FieldContainer>

        </Items>



        <Items>

         <%--Contenedor datos basicos de la up sofia  --%>

            <ext:FieldSet 
                runat="server"
                Title="Detalle de la Up"
                DefaultAnchor="100%">
                <Defaults>
                    <ext:Parameter Name="labelWidth" Value="89" Mode="Raw" />
                </Defaults>
                <Items>
               
                      

                     <ext:FieldContainer 
                runat="server" 
                FieldLabel="Nombre Up" 
                AnchorHorizontal="100%" 
                Layout="HBoxLayout">                                       
                <Items>
                    <ext:TextField ID ="Txt_Nomb_UP2" runat="server" Width="250" Margins="0 3 0 0" ReadOnly="true"/>                    
                </Items>
            </ext:FieldContainer>

                 


                    <%-- Numero de actas sofia plus al registro ya seleccionado --%>

                <ext:FieldContainer 
                runat="server" 
                FieldLabel="Cod. Centro" 
                AnchorHorizontal="100%" 
                Layout="HBoxLayout">                                       
                <Items>
                      
                      <ext:TextField ID="Txt_Cod_Cent_Form2" runat="server" Width="250" Margins="0 3 0 0" ReadOnly="true"/>                  
                </Items>
            </ext:FieldContainer>


             <%-- Numero de la ficha --%>

                <ext:FieldContainer 
                runat="server" 
                FieldLabel="No. Ficha" 
                AnchorHorizontal="100%" 
                Layout="HBoxLayout">                                       
                <Items>
                    <ext:TextField   ID="Txt_NFicha_UP2" runat="server" Width="250" Margins="0 3 0 0" ReadOnly="true"/>                    
                </Items>
            </ext:FieldContainer>

                </Items>




            </ext:FieldSet>
        </Items>

        

           <Items>

         <%--Contenedor datos basicos de la up sofia  --%>

            <ext:FieldSet 
                runat="server"
                Title="Datos de los Nuevos Socios"
                DefaultAnchor="100%">
                <Defaults>
                    <ext:Parameter Name="labelWidth" Value="89" Mode="Raw" />
                </Defaults>
                <Items>



                      <%--Se listan todos los aprendcies de la unidad productiva segun bd Sofia Plus --%>

                      
                      <ext:FieldContainer  runat="server"   MsgTarget="Side" CombineErrors="true"  FieldLabel="Aprendices de Sofia Plus"   Layout="HBoxLayout">    
                                   
                          <Items>
                                  <ext:SelectBox
                                ID="Slb_Socios"
                                runat="server" 
            
                                ValueField="Identificacion"
                                DisplayField="Nombre"

                                EmptyText="Seleccione el nuevo Socio" 
                                >
                            <Store>
                                 <ext:Store runat="server" ID="Str_Socio">
                                <Model>
                                        <ext:Model runat="server">
                                        <Fields>
                                        <ext:ModelField Name="Identificacion" Type="Int" />
                                        <ext:ModelField Name="Nombre" Type="String"/>
                                    </Fields>
                                </ext:Model>
                    </Model>            
                </ext:Store>    
                       </Store>    
                            </ext:SelectBox>
                              </Items>
                         </ext:FieldContainer>




               
         <%--Se lista los roles de los socios segun bd tabla rol socio --%>
                    <ext:FieldContainer  runat="server"   MsgTarget="Side" CombineErrors="true"  FieldLabel="Seleccione el Rol"   Layout="HBoxLayout">    
                                   
                          <Items>
                               <ext:MultiCombo runat="server" Width="260"   ValueField="Id_Rol" DisplayField="Nomb_Rol"   EmptyText="Seleccione el Rol" >
                            <Store>
                                 <ext:Store runat="server" ID="Str_Rol_Socio">
                                <Model>
                                        <ext:Model runat="server">
                                        <Fields>
                                        <ext:ModelField Name="Id_Rol" Type="Int" />
                                        <ext:ModelField Name="Nomb_Rol" Type="String"/>
                                        </Fields>
                                        </ext:Model>
                                 </Model>            
                                </ext:Store>    
                            </Store> 
                         </ext:MultiCombo>
                              </Items>
                         </ext:FieldContainer>       
                 <ext:Toolbar     runat="server"       Flex="1"     Flat="true">   
                        <Items>
                            <ext:Button ID="Button1" runat="server" Text="Registrar" Icon="UserAdd">
                                   <DirectEvents>
                                   <Click OnEvent="Btn_Registrar_Socio_Click">
                                   <EventMask ShowMask="true" Msg="Registrando..." MinDelay="500" />
                                  </Click>
                           </DirectEvents>
                         </ext:Button>
                            
                        </Items>
                    </ext:Toolbar>
                     
                </Items>



            </ext:FieldSet>

  



<ext:FieldSet 
                runat="server"
                Title="LISTADO DE SOCIOS DE LA UNIDAD PRODUCTIVA"
                DefaultAnchor="100%">
                <Defaults>
                    <ext:Parameter Name="labelWidth" Value="89" Mode="Raw" />
                </Defaults>
               <Items>
                    <ext:GridPanel
                    runat="server" 
                    Header="false"
                    Border="false">                         
                    <Store>
                         <%--Data Grid socios de la up --%>
                         <%--Cada registro debe tener un boton para eliminar un socio (boton-WebMethodo)--%>
                        <ext:Store ID="Str_Socios_Ip" runat="server" PageSize="10">
                            <Model>
                                <ext:Model runat="server" IDProperty="Id_Prod_Final">
                                    <Fields>
                                       
                                        <ext:ModelField Name="Identificacion" Type="Int" />
                                        <ext:ModelField Name="Nombre" Type="String"/>
                                        <ext:ModelField Name="Nomb_Rol" Type="String" />
                                        
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                             <ext:Column runat="server" 
                                Text="IDENTIFICACION" 
                                Width="30" 
                                Sortable="true" 
                                DataIndex="Identificacion" 
                                />
                            <ext:Column runat="server" 
                                Text="SOCIO" 
                                Width="60" 
                                Sortable="true" 
                                DataIndex="Nombre" 
                                />
                            <ext:Column runat="server" 
                                Text="ROL" 
                                Width="80" 
                                Sortable="true" 
                                DataIndex="Nomb_Rol"
                                Flex="1" 
                                />
                       
                           
                            <ext:Column runat="server" 
                               
                                Width="20" 
                                Sortable="true" 
                                Flex="1"   >
                             <Commands>
                             <ext:ImageCommand CommandName="Edit" Icon="Delete" Text="Borrar">
                                <ToolTip Text="Edit" />
                             </ext:ImageCommand>
                             </Commands>
                             <Listeners>
                             <Command  Handler="#{DirectMethods}.BorrarProducto(record.data.Id_Prod_Ofert);" />
                             </Listeners>
                              </ext:Column>



                        </Columns>
                    </ColumnModel>
                    <View>
                        <ext:GridView runat="server" LoadMask="false" />
                    </View>
                    <Features>
                        <ext:GridFilters runat="server" Local="true">
                            <Filters>
                                <ext:NumericFilter DataIndex="ID" />
                                <ext:StringFilter DataIndex="Name" />
                                <ext:DateFilter DataIndex="Start">
                                    <DatePickerOptions runat="server" TodayText="Now" />
                                </ext:DateFilter>
                                <ext:DateFilter DataIndex="End">
                                    <DatePickerOptions runat="server" TodayText="Now" />
                                </ext:DateFilter>                        
                                <ext:BooleanFilter DataIndex="Completed" />
                            </Filters>
                        </ext:GridFilters>
                    </Features>
                    <BottomBar>
                        <ext:PagingToolbar 
                            runat="server" 
                            DisplayInfo="true"
                            DisplayMsg="Mostrando Productos {0} - {1} of {2}"
                            />
                    </BottomBar>
                </ext:GridPanel>
                    
                     
              </Items>

   </ext:FieldSet>




















        </Items>

      


       
  
</ext:FormPanel>

    </form>
</body>
</html>

